#ifndef PRODUCT_SPACE_HPP
#define PRODUCT_SPACE_HPP

#include "ElementarySpace.hpp"

#include <list>
#include <stdexcept>
#include <iostream>

class ProductSpace {
	public:
		ProductSpace() {};
		ProductSpace(const ElementarySpace& es);
		ProductSpace& operator*=(const ProductSpace& other);
		int dim() const;
		const std::list<ElementarySpace>& subSpaces() const {
			return subSpaces_;};
		void print() const;
	private:
		std::list<ElementarySpace> subSpaces_;
		/// Returns true if none of the subspaces have the same tag as es 
		bool newTag(const ElementarySpace& es);
};

/// Returns the tensor product of the spaces h1 and h2.
ProductSpace tensorProduct(const ProductSpace& h1, const ProductSpace& h2);



#endif
